package io.kimmking.dubbo.common.balance.impl;

import io.kimmking.spi.Join;

import java.util.List;
import java.util.Random;

@Join
public class RandomLoadBalance extends AbstractLoadBalance{

    private static final Random RANDOM = new Random();

    @Override
    protected String doSelect(final List<String> upstreamList, String from_ip) {
        return upstreamList.get(RANDOM.nextInt(upstreamList.size()));
    }
}
